import { Module } from '@nestjs/common';
import { TypeOrmModule } from '@nestjs/typeorm';
import { ShopUsersEntity } from './entities/shop-users.entity';
import { ShopUsersController } from './shop-users.controller';
import { ShopUsersService } from './shop-users.service';
import { JwtModule } from '@nestjs/jwt';
import { ConfigModule, ConfigService } from '@nestjs/config';

@Module({
  imports: [
    TypeOrmModule.forFeature([ShopUsersEntity]),
    JwtModule.registerAsync({
      imports: [ConfigModule],
      useFactory: async (config: ConfigService) => ({
        secret: config.get('jwt.secretkey'),
      }),
      inject: [ConfigService],
    }),
  ],
  controllers: [ShopUsersController],
  providers: [ShopUsersService],
  exports: [ShopUsersService],
})
export class ShopUsersModule {}
